-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] Transforms/DFA: Refactor list action buttons so modals won't unmount after button click. #70555
Conversation
9a98e59
to
9033dbf
Compare
dd42b81
to
996e151
Compare
Pinging @elastic/ml-ui (:ml) |
@thompsongl This PR resolves #70383 in preparation for the EUI update in #70243. No need for you to review the full PR, added you as a reviewer for visibility. |
|
||
return ( | ||
<> | ||
{isModalVisible && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it would be cleaner if a parent component will be responsible for hiding the modal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 4382fee
? i18n.translate( | ||
'xpack.ml.dataframe.analyticsList.deleteActionDisabledToolTipContent', | ||
{ | ||
defaultMessage: 'Stop the data frame analytics in order to delete it.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would read better with the word job
in it - Stop the data frame analytics job in order to delete it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in f4186e7.
...ta_frame_analytics/pages/analytics_management/components/action_start/start_button_modal.tsx
Outdated
Show resolved
Hide resolved
})} | ||
data-test-subj="mlAnalyticsJobViewButton" | ||
> | ||
{i18n.translate('xpack.ml.dataframe.analyticsList.viewActionName', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can be replaced with FormattedMessage
...on/data_frame_analytics/pages/analytics_management/components/analytics_list/use_actions.tsx
Outdated
Show resolved
Hide resolved
...ion/data_frame_analytics/pages/analytics_management/components/action_clone/clone_button.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and LGTM
@alvarezmelissa87 I re-merged |
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
History
To update your PR or re-run it, just comment with: |
@darnautov addressed your comments, and all tests finally passed 🥳 please have another look 👁️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave this a test - LGTM ⚡
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ount after button click. (elastic#70555) Related to elastic#70383 and elastic#63455. Refactors the action buttons of the transform and data frame analytics jobs list: Previously custom actions included state and JSX for e.g. confirmation modals. Problem with that: If the actions list popover hides, the modal would unmount too. Since EUI's behaviour will change with the release/merge of elastic#70383, we needed a refactor that solves that issue right now. With this PR, state management for UI behaviour that follows after a button click like the confirmation modals was moved to a custom hook which is part of the outer level of the buttons itself. The modal now also gets mounted on the outer level. This way we won't loose the modals state and DOM rendering when the action button hides. Note that this PR doesn't fix the nested buttons issue (elastic#63455) yet. For that we need EUI issue elastic#70383 to be in Kibana which will arrive with EUI v26.3.0 via elastic#70243. So there will be one follow up to that which will focus on getting rid of the nested button structure.
…ount after button click. (#70555) (#71050) Related to #70383 and #63455. Refactors the action buttons of the transform and data frame analytics jobs list: Previously custom actions included state and JSX for e.g. confirmation modals. Problem with that: If the actions list popover hides, the modal would unmount too. Since EUI's behaviour will change with the release/merge of #70383, we needed a refactor that solves that issue right now. With this PR, state management for UI behaviour that follows after a button click like the confirmation modals was moved to a custom hook which is part of the outer level of the buttons itself. The modal now also gets mounted on the outer level. This way we won't loose the modals state and DOM rendering when the action button hides. Note that this PR doesn't fix the nested buttons issue (#63455) yet. For that we need EUI issue #70383 to be in Kibana which will arrive with EUI v26.3.0 via #70243. So there will be one follow up to that which will focus on getting rid of the nested button structure. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: [RUM Dashboard] New rum services api to replace usage of get services API (elastic#70746) fix: remove only consecutive ticks in TSVB (elastic#70981) [Functional test] Increase the timeout on opening a saved visualization (elastic#70952) [ML] Transforms/DFA: Refactor list action buttons so modals won't unmount after button click. (elastic#70555) [Functional test] Add retry for dashboard save (elastic#70950)
Related to #70383 and #63455.
Refactors the action buttons of the transform and data frame analytics jobs list:
Previously custom actions included state and JSX for e.g. confirmation modals. Problem with that: If the actions list popover hides, the modal would unmount too. Since EUI's behaviour will change with the release/merge of #70383, we needed a refactor that solves that issue right now.
With this PR, state management for UI behaviour that follows after a button click like the confirmation modals was moved to a custom hook which is part of the outer level of the buttons itself. The modal now also gets mounted on the outer level. This way we won't loose the modals state and DOM rendering when the action button hides.
Note that this PR doesn't fix the nested buttons issue (#63455) yet. For that we need EUI issue #70383 to be in Kibana which will arrive with EUI v26.3.0 via #70243. So there will be one follow up to that which will focus on getting rid of the nested button structure.
Todos
master
Checklist
Delete any items that are not applicable to this PR.
For maintainers